import {
  IsNotEmpty,
  IsString,
  IsOptional,
  IsEnum,
  IsEmail,
  IsMobilePhone,
  IsNumber,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Transform, Expose, Exclude } from 'class-transformer';

export class StructDto {

  @ApiPropertyOptional({
    description: '机构类型'
  })
  @IsOptional()
  readonly type?: number;

  @ApiPropertyOptional({
    description: '机构状态',
    enum: [0, 1],
  })
  @IsNumber()
  @Transform(value => parseInt(value, 10))
  @IsEnum({ 禁用: 0, 启用: 1 }, { message: '机构状态,0表示禁用,1表示启用' })
  @IsOptional()
  readonly status?: number;

  @ApiPropertyOptional({
    description: '机构描述'
  })
  readonly note?: string;

  @ApiPropertyOptional({
    description: '详细地址'
  })
  readonly detail?: string;

}